from autogen_core.models import UserMessage
from autogen_ext.models.ollama import OllamaChatCompletionClient

# 测试ollama客户端
ollama_model_client = OllamaChatCompletionClient(model="modelscope.cn/unsloth/Qwen3-14B-GGUF:Q5_K_M",
                                                 model_info={
                                                     "vision": False,
                                                     "function_calling": True,
                                                     "family": "Qwen3",
                                                     "structured_output": True,
                                                     "json_output": True,
                                                 })

async def test_run_chat():
    response = await ollama_model_client.create([UserMessage(content="英国首都是什么?", source="user")],extra_create_args={
        "think": False,
    })
    print(response)

if __name__ == "__main__":
    import asyncio
    asyncio.run(test_run_chat())